package com.njtoyo.taxi.admin.mongo.entity.primary;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexType;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

@Document(collection = "call_geo_circle_fence")
@Data
@Accessors(chain = true)
@NoArgsConstructor
public class CallGeoCircleFenceMongo {

    /**
     * 主键
     */
    @Id
    private ObjectId id;

    /**
     * 乘客区域ID
     */
    private Long customerRegionId;

    /**
     * 区域ID
     */
    private Long areaId;

    private Long ruleId;

    /**
     * 半径距离
     */
    private Double distance;

    /**
     * 位置名称
     */
    private String locationName;

    /**
     * 地理位置
     */
    @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
    private GeoJsonPoint location;

    /**
     * 创建时间
     */
    private Date createdAt;

}